<?php
namespace Admin\Controller;

class RedbagController extends AdminController{

	public function index(){
        $list   = $this->lists('Redbag');
        foreach ($list as $key => &$value) {
        	$value['name'] = M('member')->where(array('uid'=>$value['uid']))->getField('nickname');
        }
        $this->assign('_list', $list);
        $this->meta_title = '红包列表';
		$this->display();
	}
	public function redbag_detail(){
		$id = I('id',0);
		$map = array('rid'=>$id);
		$list = $this->lists('redbag_list',$map);
        foreach ($list as $key => &$value) {
        	$value['name'] = M('member')->where(array('uid'=>$value['uid']))->getField('nickname');
        }
		$this->assign('_list',$list);
		$this->display();
	}
}